Data Collection is done through our app: We use a user's email and password for authentication, and input our own values for menu items, etc in the database.

Example of authentication:

import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
FirebaseAuth auth;
auth = FirebaseAuth.getInstance();
final String email = emailText.getText().toString();
final String password = passwordText.getText().toString();

auth.signInWithEmailAndPassword(email, password).addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {
	@Override
	public void onComplete(@NonNull Task<AuthResult> task) {
		if (!task.isSuccessful()) { ... }
		else { ... }
	}
});


Example of reading from the database:

import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
private FirebaseDatabase database;
database= FirebaseDatabase.getInstance();
DatabaseReference databaseReference= database.getReference();
databaseReference.child("foodmenu");

Example of writing to the database:

private FirebaseDatabase database;
database = FirebaseDatabase.getInstance();
DatabaseReference myRef = database.getReference("foodmenu");
myRef.child("foodmenu").child("Cheese Burger").child("Price").addListenerForSingleValueEvent(new ValueEventListener() {
	@Override
	public void onDataChange(DataSnapshot dataSnapshot) {
		if(dataSnapshot.getValue() != null){
			float value = Float.parseFloat(dataSnapshot.getValue().toString());
			Menu.setTotal(value);
		}
}